package com.xyht.sca_s.student_manage_system.modules.common.controller;


import com.xyht.sca_s.student_manage_system.common.commonReturn.ResponseResult;
import com.xyht.sca_s.student_manage_system.modules.common.service.SmsImportTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 * 批量导入任务表 前端控制器
 * </p>
 *
 * @author XYHT
 * @since 2022-11-29
 */
@RestController
public class SmsImportTaskController {
    @Autowired
    private SmsImportTaskService smsImportTaskService;

        @GetMapping("/org/importTask/list")
        public ResponseResult getImportTaskList(HttpServletRequest request,
                                                @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
                                                @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                @RequestParam(value = "task_type", required = false) Integer task_type
                                                ){
            return smsImportTaskService.getImportTaskList(task_type,request,pageSize,pageNum);
        }

        @GetMapping("/org/importTask/details")
        public ResponseResult getImportTaskDetail(@RequestParam("task_id") String task_id){
            return smsImportTaskService.getImportTaskDetail(task_id);
        }
}

